package com.leiyuee.Thread;

import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;

/**
 * @Author : Yu_Lei
 * @create 2024/3/11
 */
public class MyCallable implements Callable<String> {
    @Override
    public String call() throws Exception {
        System.out.println("实现callable");
        return "call";
    }

    public static void main(String[] args) {
        MyCallable myCallable = new MyCallable();
        FutureTask<String> task = new FutureTask<>(myCallable);
        new Thread(task).start();
    }

}
